﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EmpExamList.aspx.cs" Inherits="Web.EmpExamList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <base target="_self" />
    <meta content="ie=7" http-equiv="x-ua-compatible"/>
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache"/>
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"/>
    <META HTTP-EQUIV="Expires" CONTENT="0"/>
    <link href="Styles/Style01.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery-1.7.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        //取get参数
        function getArg() {
            var url = unescape(window.location.href);
            var allArgs = url.split("?")[1];
            if (allArgs != null) {
                var args = allArgs.split("&");
                for (var i = 0; i < args.length; i++) {
                    var arg = args[i].split("=");
                    eval('this.' + arg[0] + '="' + arg[1] + '";');
                }
            }
        }
        var urlArg = new getArg();
        var empId = urlArg.empId;

        function add() {
            var url = 'EmpExamEdit.aspx?empId=' + empId;
            var retVal = window.showModalDialog(url, window, 'dialogWidth=850px;dialogHeight=550px;status=no;help=no;');
            if (retVal != undefined && !isNaN(retVal)) {
                window.name = "__self";
                window.open(window.location.href, "__self");
            }
        }
        function edit(id) {
            var url = 'EmpExamEdit.aspx?id=' + id;
            var retVal = window.showModalDialog(url, window, 'dialogWidth=850px;dialogHeight=550px;status=no;help=no;');
            if (retVal != undefined && !isNaN(retVal)) {
                window.name = "__self";
                window.open(window.location.href, "__self");
            }
        }
        function del(id) {
            if (confirm('您确定删除该行记录吗?')) {
                $.ajax({ type: 'post', url: "/EmpProfile.mvc/DeleteExams", data: { id: id },
                    success: function (data, textStatus) {
                        if (data == "Succeed") { location.href = location.href; }
                    }
                });
            }
        }
    </script>
</head>
<body>
<form id="Form1" runat="server">
	<asp:Repeater ID="rptList" EnableViewState="False" Runat="server">
		<HeaderTemplate>
			<table id="tbList" class="s1 list">
				<thead>
					<TR>
						<th width="10%">开始日期</th>
						<th width="10%">结束日期</th>
						<th width="10%">考核目标</th>
						<th width="10%">考核结果</th>
						<th width="10%">评估</th>
						<th width="10%">本人意见</th>
						<th width="10%">备注</th>
						<th class="tdOrder">操作</th>
					</TR>
				</thead><tbody>
		</HeaderTemplate>
		<ItemTemplate>
			<tr class="<%# Container.ItemIndex%2==0?"bg":""%>">
				<td><%# DataBinder.Eval(Container.DataItem, "StartDate", "{0:d}")%></td>
				<td><%# DataBinder.Eval(Container.DataItem, "EndDate", "{0:d}")%></td>
				<td><%# DataBinder.Eval(Container.DataItem, "ExamPurpose")%></td>
				<td><%# DataBinder.Eval(Container.DataItem, "ExamResult")%></td>
				<td><%# DataBinder.Eval(Container.DataItem, "ExamEvaluation")%></td>
				<td><%# DataBinder.Eval(Container.DataItem, "PersonalOpinion")%></td>
				<td><%# DataBinder.Eval(Container.DataItem, "Remark")%></td>
				<td>
                    <a href="#" onclick="edit(<%# DataBinder.Eval(Container.DataItem,"Id") %>);return false;">[编辑]</a>
                    <a href="#" onclick="del(<%# DataBinder.Eval(Container.DataItem,"Id") %>);return false;">[删除]</a>
				</td>
			</tr>
		</ItemTemplate>
		<FooterTemplate>
			</tbody> </table>
		</FooterTemplate>
	</asp:Repeater>
    <div style="text-align:right;margin-right:24px;margin-top:6px;">
        <input id="btnAdd" class="btn" type="button" value="新增" onclick="add();"/>
    </div>
</form>
</body>
</html>
